Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index pattern(s) take dependencies as object #69055

Merged
merged 3 commits into from
Jun 13, 2020

Conversation

mattkime
Copy link
Contributor

@mattkime mattkime commented Jun 12, 2020

Summary

Simple refactor so IndexPatterns and IndexPattern classes take their dependencies as an object instead of as numerous individual arguments. These classes take different numbers of args in 8.x vs 7.x due to a different number of UI callbacks. Time based index patterns are unsupported in 8.x while merely deprecated in 7.x

This PR will help prevent future merge conflicts.

@mattkime mattkime added Team:AppArch v8.0.0 v7.9.0 Feature:Data Views Data Views code and UI - index patterns before 8.0 labels Jun 12, 2020
@mattkime mattkime marked this pull request as ready for review June 12, 2020 18:47
@mattkime mattkime requested a review from a team as a code owner June 12, 2020 18:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@mattkime mattkime added the release_note:skip Skip the PR/issue when compiling release notes label Jun 12, 2020
Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, added some feedback about the casts to any in tests below that would be nice to get rid of as part of this.

savedObjectsClient as any,
const indexPattern = new IndexPattern(id, {
getConfig: (cfg: any) => config.get(cfg),
savedObjectsClient: savedObjectsClient as any,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're already in this code could we get rid of these as any references? Seems like it should be fairly trivial to actually use the savedObjectsServiceMock.createStartContract() and then do something like savedObjectsClient.get.mockReturnValue(object), etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at this but realized that these dependencies will be changing shortly. This is code in common but we don't have common mocks.

I improved the fieldForms mock as that is the same across public and server

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mattkime mattkime merged commit 85ebaed into elastic:master Jun 13, 2020
mattkime added a commit that referenced this pull request Jun 13, 2020
* index pattern(s) take dependencies as object
# Conflicts:
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md
#	src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts
#	src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
#	src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts
#	src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts
#	src/plugins/data/public/plugin.ts
#	src/plugins/data/public/public.api.md
mattkime added a commit that referenced this pull request Jun 13, 2020
* index pattern(s) take dependencies as object (#69055)
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 15, 2020
* master: (91 commits)
  [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116)
  [Observability] Create context container to enable Observability plugin registry function (elastic#68642)
  Rename space id for disabled index pattern test (elastic#68990)
  skip flaky suite (elastic#63339)
  Resolver Light Theme And Kibana Integration (elastic#67859)
  [kbn/dev-utils] expose public tooling_log module (elastic#68868)
  index pattern(s) take dependencies as object (elastic#69055)
  include ci-stats metrics in pr comment (elastic#68563)
  Bump webpack packages (elastic#68716)
  [Uptime] Fixed metric query broken because of missing mapping (elastic#68999)
  Added cloud as an optional dependency (elastic#69050)
  Fixed all external links (elastic#68614)
  [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069)
  [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577)
  [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067)
  [ML] Fix cloud deployment ID check (elastic#68695)
  [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033)
  Add ingest manager topic to docs (elastic#68980)
  [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582)
  [DOCS] Fixes POST request for saved objects (elastic#69036)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 15, 2020
* master: (60 commits)
  Re-enable mistakenly skipped tests. (elastic#69123)
  [Search][BUG] Call wrong search strategy recursively in async search (elastic#69116)
  [Observability] Create context container to enable Observability plugin registry function (elastic#68642)
  Rename space id for disabled index pattern test (elastic#68990)
  skip flaky suite (elastic#63339)
  Resolver Light Theme And Kibana Integration (elastic#67859)
  [kbn/dev-utils] expose public tooling_log module (elastic#68868)
  index pattern(s) take dependencies as object (elastic#69055)
  include ci-stats metrics in pr comment (elastic#68563)
  Bump webpack packages (elastic#68716)
  [Uptime] Fixed metric query broken because of missing mapping (elastic#68999)
  Added cloud as an optional dependency (elastic#69050)
  Fixed all external links (elastic#68614)
  [DOCS] Reorganizes doc nav to match new Kibana nav (elastic#69069)
  [Endpoint] Using the stats provided by the backend for resolver UI (elastic#68577)
  [DOCS] Removees 8.0 from Upgrade Assistant docs (elastic#69067)
  [ML] Fix cloud deployment ID check (elastic#68695)
  [DOCS] Move metrics app content to metrics monitoring guide (elastic#69033)
  Add ingest manager topic to docs (elastic#68980)
  [SECURITY SOLUTION] EMT-401: add policy data to metadata and fix tests (elastic#68582)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants